package ormpool

type SysProxy interface {
	Register(schema string, opt ...Option) (OrmKey, error)
	Release(key OrmKey) error
}
type sysProxy struct {
	ormProxy    OrmProxy
	tenantProxy TenantProxy
}

func newSysProxy(ormProxy OrmProxy, tenantProxy TenantProxy) SysProxy {
	return &sysProxy{
		ormProxy:    ormProxy,
		tenantProxy: tenantProxy,
	}
}
func (s *sysProxy) Register(schema string, opt ...Option) (OrmKey, error) {
	return s.ormProxy.CreatPool(schema, opt...)
}

func (s *sysProxy) Release(key OrmKey) error {
	return s.tenantProxy.release(key)
}
